$color_1: var(--shizuku-text-color);
$color_2: var(--shizuku-theme-color);
$color_3: inherit;
$color_4: rgba(128, 128, 128, 0.4);
$color_5: #333;
$color_6: rgba(160, 160, 160, 0.4);
$color_7: #bbb;
$font_family_1: 'Noto Serif SC', 'Avenir Next', 'PingFang SC',
  'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
$font_family_2: 'PingFang SC', -apple-system, 'Microsoft YaHei';
$background_color_1: transparent;

:root {
  background: var(--shizuku-background-color);
  color: $color_1;
  --shizuku-background-color: #fff;
  --shizuku-text-color: #333;
  --shizuku-theme-color: #2bd;
}

#markdown-render,
article {
  font-family: $font_family_1;
  font-size: 16px;
  line-height: 1.75;
  word-wrap: break-word;
  text-align: justify;
  -webkit-user-select: none;
  &::selection {
    background: rgba(160, 160, 160, 0.1);
  }
  &::-webkit-selection {
    background: rgba(160, 160, 160, 0.1);
  }
  > * {
    margin-top: 18px !important;
    margin-bottom: 18px !important;
    -webkit-user-select: text;
    &:first-child {
      margin-top: 0 !important;
    }
    &:last-child {
      margin-bottom: 0 !important;
    }
  }
  a {
    color: $color_2;
    text-decoration: none;
    position: relative;
    &:hover {
      color: $color_2;
      text-decoration: none;
    }
    &::after {
      content: '';
      position: absolute;
      bottom: 0;
      width: 0;
      height: 1px;
      left: 0;
      right: 0;
      margin: auto;
      background-color: var(--shizuku-theme-color);
      transition: width 0.5s;
    }
    &:hover::after {
      width: 100%;
    }

    &:active {
      color: $color_2;
      text-decoration: none;
    }
    &:focus {
      color: $color_2;
      text-decoration: none;
    }
    &:visited {
      color: $color_2;
      text-decoration: none;
    }
    &:not([href]) {
      color: $color_3;
      text-decoration: none;
    }
  }
  p {
    text-align: justify;
    word-wrap: break-word;
    word-break: break-all;
  }
  blockquote {
    text-align: justify;
    word-wrap: break-word;
    word-break: break-all;
    position: relative;
    padding: 10px 20px;
    color: var(--shizuku-theme-color);
    border-left: 3px solid rgba(#2bd, 0.7);
    background: rgba($color: #2bd, $alpha: 0.02);
    margin-left: 0;
  }
  ul {
    text-align: justify;
    word-wrap: break-word;
    word-break: break-all;
    padding-left: 2em;
    font-size: 95%;
    list-style-type: disc;
    ul {
      margin-top: 0;
      margin-bottom: 0;
    }
    ol {
      margin-top: 0;
      margin-bottom: 0;
    }
  }
  ol {
    text-align: justify;
    word-wrap: break-word;
    word-break: break-all;
    padding-left: 2em;
    font-size: 95%;
    list-style-type: decimal;
    ol {
      margin-top: 0;
      margin-bottom: 0;
    }
    ul {
      margin-top: 0;
      margin-bottom: 0;
    }
  }
  dl {
    text-align: justify;
    word-wrap: break-word;
    word-break: break-all;
    padding: 0;
    dt {
      padding: 0;
      margin-top: 16px;
      font-size: 1em;
      font-style: italic;
      font-weight: 600;
    }
    dd {
      padding: 0 16px;
      margin-bottom: 16px;
    }
  }
  table {
    text-align: justify;
    word-wrap: break-word;
    word-break: break-all;
    display: block;
    width: 100%;
    overflow: auto;
    border-collapse: collapse;
    th {
      font-weight: 600;
      padding: 5px 10px;
      border: 1px solid rgba(128, 128, 128, 0.1);
      border-collapse: collapse;
    }
    td {
      padding: 5px 10px;
      border: 1px solid rgba(128, 128, 128, 0.1);
      border-collapse: collapse;
    }
    tr {
      border-top: 1px solid rgba(128, 128, 128, 0.4);
      border-collapse: collapse;
    }
  }
  pre {
    text-align: justify;
    word-wrap: break-word;
    word-break: break-all;
    font: 95% 'Fira Code', 'Source Code Pro', Consolas, 'Liberation Mono', Menlo,
      Courier, monospace, 'PingFang SC', 'Microsoft YaHei UI';
    user-select: text;
    word-wrap: normal;
    overflow: auto;
    font-size: 95%;
    line-height: 1.45;
    background: none;
    > code {
      padding: 0;
      margin: 0;
      font-size: 100%;
      word-break: normal;
      white-space: pre;
      background: transparent;
      border: 0;
    }
    &:not(.CodeMirror-line) {
      &::before {
        content: ' ';
        display: block;
        width: 25px;
        height: 1px;

        margin: 20px 0;
        -webkit-user-select: none;
      }
      &::after {
        content: ' ';
        display: block;
        width: 25px;
        height: 1px;
        margin: 20px 0;
        -webkit-user-select: none;
      }
    }
    & {
      &::before {
        background: var(--shizuku-theme-color);
      }
      &::after {
        background: var(--shizuku-theme-color);
      }
    }
    code {
      display: inline;
      max-width: auto;
      padding: 0;
      margin: 0;
      overflow: visible;
      line-height: inherit;
      word-wrap: normal;
      background-color: $background_color_1;
      border: 0;
      &::before {
        content: normal;
      }
      &::after {
        content: normal;
      }
    }
    tt {
      display: inline;
      max-width: auto;
      padding: 0;
      margin: 0;
      overflow: visible;
      line-height: inherit;
      word-wrap: normal;
      background-color: $background_color_1;
      border: 0;
      &::before {
        content: normal;
      }
      &::after {
        content: normal;
      }
    }
  }
  hr {
    display: inline-block;
    width: 25px;
    height: 1px;
    line-height: 1px;
    border: 0;
    margin: 0;
    background: rgba(128, 128, 128, 0.4);
    vertical-align: middle;
  }
  .md-hr {
    outline: none !important;
  }
  .md-hr.md-focus {
    hr {
      background: var(--shizuku-theme-color);
    }
  }
  .loweralpha {
    list-style-type: lower-alpha;
  }
  .md-blockmeta {
    font-style: normal;
    font-weight: normal;
    color: $color_4;
  }
  .md-header-span {
    font-style: normal;
    font-weight: normal;
    color: $color_4;
    background: rgba(128, 128, 128, 0.2);
  }
  strong {
    font-weight: 500;
    font-family: $font_family_2;
  }

  @for $var from 1 through 6 {
    h#{$var} {
      font-size: 1.2rem;
    }
  }

  h1 {
    font-weight: 600;
    line-height: 1.2;
    vertical-align: baseline;
    &::before {
      border: 0 none !important;
      border-radius: 0 !important;
      position: static !important;
      left: auto !important;
      top: auto !important;
      float: none !important;
      padding-left: initial !important;
      padding-right: initial !important;
      vertical-align: inherit !important;
      display: inline-block;
      margin-left: -72px;
      width: 60px;
      margin-right: 12px;
      height: 1em;
      line-height: 1em;
      text-align: right;
      color: $color_4;
      font-size: 14px;
      font-weight: normal;
      content: 'h1';
    }
  }
  h2 {
    font-weight: 600;
    line-height: 1.2;
    vertical-align: baseline;
    &::before {
      border: 0 none !important;
      border-radius: 0 !important;
      position: static !important;
      left: auto !important;
      top: auto !important;
      float: none !important;
      padding-left: initial !important;
      padding-right: initial !important;
      vertical-align: inherit !important;
      display: inline-block;
      margin-left: -72px;
      width: 60px;
      margin-right: 12px;
      height: 1em;
      line-height: 1em;
      text-align: right;
      color: $color_4;
      font-size: 14px;
      font-weight: normal;
      content: 'h2';
    }
  }
  h3 {
    font-weight: 600;
    line-height: 1.2;
    vertical-align: baseline;
    &::before {
      border: 0 none !important;
      border-radius: 0 !important;
      position: static !important;
      left: auto !important;
      top: auto !important;
      float: none !important;
      padding-left: initial !important;
      padding-right: initial !important;
      vertical-align: inherit !important;
      display: inline-block;
      margin-left: -72px;
      width: 60px;
      margin-right: 12px;
      height: 1em;
      line-height: 1em;
      text-align: right;
      color: $color_4;
      font-size: 14px;
      font-weight: normal;
      content: 'h3';
    }
  }
  h4 {
    font-weight: 600;
    line-height: 1.6;
    vertical-align: baseline;
    &::before {
      border: 0 none !important;
      border-radius: 0 !important;
      position: static !important;
      left: auto !important;
      top: auto !important;
      float: none !important;
      padding-left: initial !important;
      padding-right: initial !important;
      vertical-align: inherit !important;
      display: inline-block;
      margin-left: -72px;
      width: 60px;
      margin-right: 12px;
      height: 1em;
      line-height: 1em;
      text-align: right;
      color: $color_4;
      font-size: 14px;
      font-weight: normal;
      content: 'h4';
    }
  }
  h5 {
    font-weight: 600;
    line-height: 1.4;
    vertical-align: baseline;
    &::before {
      border: 0 none !important;
      border-radius: 0 !important;
      position: static !important;
      left: auto !important;
      top: auto !important;
      float: none !important;
      padding-left: initial !important;
      padding-right: initial !important;
      vertical-align: inherit !important;
      display: inline-block;
      margin-left: -72px;
      width: 60px;
      margin-right: 12px;
      height: 1em;
      line-height: 1em;
      text-align: right;
      color: $color_4;
      font-size: 14px;
      font-weight: normal;
      content: 'h5';
    }
  }
  h6 {
    font-weight: 600;
    line-height: 1.25;
    vertical-align: baseline;
    &::before {
      border: 0 none !important;
      border-radius: 0 !important;
      position: static !important;
      left: auto !important;
      top: auto !important;
      float: none !important;
      padding-left: initial !important;
      padding-right: initial !important;
      vertical-align: inherit !important;
      display: inline-block;
      margin-left: -72px;
      width: 60px;
      margin-right: 12px;
      height: 1em;
      line-height: 1em;
      text-align: right;
      color: $color_4;
      font-size: 14px;
      font-weight: normal;
      content: 'h6';
    }
  }
  > ul {
    padding-left: 0;
    font-size: inherit;
  }
  > ol {
    padding-left: 0;
    font-size: inherit;
  }
  li {
    list-style: unset;
    & + li {
      margin-top: 0.25em;
    }
  }
  .task-list-item {
    padding-left: 0;
    input[type='checkbox'] {
      margin: 0.36em 5px;
      margin-left: -24px;
    }
  }
  img {
    max-width: 100%;
    box-sizing: content-box;
  }
  img[align='right'] {
    padding-left: 20px;
  }
  img[align='left'] {
    padding-right: 20px;
  }
  .emoji {
    max-width: none;
    vertical-align: text-top;
    background-color: $background_color_1;
  }
  span.frame {
    display: block;
    overflow: hidden;
    > span {
      display: block;
      float: left;
      width: auto;
      padding: 7px;
      margin: 13px 0 0;
      overflow: hidden;
      border: 1px solid rgba(128, 128, 128, 0.4);
    }
    span {
      img {
        display: block;
        float: left;
      }
      span {
        display: block;
        padding: 5px 0 0;
        clear: both;
        color: $color_5;
      }
    }
  }
  span.align-center {
    display: block;
    overflow: hidden;
    clear: both;
    > span {
      display: block;
      margin: 13px auto 0;
      overflow: hidden;
      text-align: center;
    }
    span {
      img {
        margin: 0 auto;
        text-align: center;
      }
    }
  }
  span.align-right {
    display: block;
    overflow: hidden;
    clear: both;
    > span {
      display: block;
      margin: 13px 0 0;
      overflow: hidden;
      text-align: right;
    }
    span {
      img {
        margin: 0;
        text-align: right;
      }
    }
  }
  span.float-left {
    display: block;
    float: left;
    margin-right: 13px;
    overflow: hidden;
    span {
      margin: 13px 0 0;
    }
  }
  span.float-right {
    display: block;
    float: right;
    margin-left: 13px;
    overflow: hidden;
    > span {
      display: block;
      margin: 13px auto 0;
      overflow: hidden;
      text-align: right;
    }
  }
  code {
    margin: 0 5px;
    padding: 0.15em 0;
    border-bottom: 1px solid var(--shizuku-theme-color);
    font: 95% 'Fira Code', 'Source Code Pro', Consolas, 'Liberation Mono', Menlo,
      Courier, monospace, 'PingFang SC', 'Microsoft YaHei UI';
    user-select: auto;
    -webkit-user-select: auto;
    &::before {
      letter-spacing: -0.2em;
    }
    &::after {
      letter-spacing: -0.2em;
    }
    br {
      display: none;
    }
  }
  tt {
    font: 95% 'Fira Code', 'Source Code Pro', Consolas, 'Liberation Mono', Menlo,
      Courier, monospace, 'PingFang SC', 'Microsoft YaHei UI';
    user-select: auto;
    -webkit-user-select: auto;
    &::before {
      letter-spacing: -0.2em;
    }
    &::after {
      letter-spacing: -0.2em;
    }
    br {
      display: none;
    }
  }
  .highlight {
    margin-bottom: 16px;
    pre {
      margin-bottom: 0;
      word-break: normal;
      overflow: auto;
      font-size: 95%;
      line-height: 1.45;
      background: none;
    }
  }

  .csv-data {
    td {
      padding: 5px;
      overflow: hidden;
      font-size: 12px;
      line-height: 1;
      text-align: left;
      white-space: nowrap;
    }
    th {
      padding: 5px;
      overflow: hidden;
      font-size: 12px;
      line-height: 1;
      text-align: left;
      white-space: nowrap;
      font-weight: 600;
      border-top: 0;
    }
    .blob-num {
      padding: 10px 8px 9px;
      text-align: right;
      border: 0;
    }
    tr {
      border-top: 0;
    }
  }
  .md-meta.md-before {
    padding: 0 0.2em;
    color: $color_6;
    background: none;
    font-family: $font_family_1;
    padding-left: 0.4em;
  }
  .md-meta.md-after {
    padding: 0 0.2em;
    color: $color_6;
    background: none;
    font-family: $font_family_1;
    padding-right: 0.4em;
  }
  .md-meta.md-show-hint {
    &::after {
      box-shadow: none;
      width: auto !important;
      padding: 5px 10px;
      background: rgba(0, 0, 0, 0.8);
      border-radius: 4px;
    }
  }
  .md-fences {
    overflow: visible;
    .code-tooltip {
      box-shadow: none;
      position: absolute;
      left: 15px;
      bottom: -10px;
      right: auto;
      top: auto;
      input {
        outline: none;
        text-align: left;
        color: $color_7;
        &::placeholder {
          color: $color_4;
        }
      }
    }
  }
  .md-fences.md-focus {
    .code-tooltip {
      input {
        color: $color_2;
      }
    }
  }
}
/**
 * prism.js default theme for JavaScript, CSS and HTML
 * Based on dabblet (http://dabblet.com)
 * @author Lea Verou
 */

code[class*='language-'],
pre[class*='language-'] {
  color: black;
  background: none;
  text-shadow: 0 1px white;
  font-size: 1em;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.5;

  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;

  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

pre[class*='language-']::-moz-selection,
pre[class*='language-'] ::-moz-selection,
code[class*='language-']::-moz-selection,
code[class*='language-'] ::-moz-selection {
  text-shadow: none;
  background: #b3d4fc91;
}

pre[class*='language-']::selection,
pre[class*='language-'] ::selection,
code[class*='language-']::selection,
code[class*='language-'] ::selection {
  text-shadow: none;
  background: #b3d4fc9f;
}

@media print {
  code[class*='language-'],
  pre[class*='language-'] {
    text-shadow: none;
  }
}

/* Code blocks */
pre[class*='language-'] {
  padding: 1em;
  margin: 0.5em 0;
  overflow: auto;
}

:not(pre) > code[class*='language-'],
pre[class*='language-'] {
  background: #f5f2f0;
}

/* Inline code */
:not(pre) > code[class*='language-'] {
  padding: 0.1em;
  border-radius: 0.3em;
  white-space: normal;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: slategray;
}

.token.punctuation {
  color: #999;
}

.namespace {
  opacity: 0.7;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #fd79a8;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: var(--shizuku-theme-color);
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #9a6e3a;
  background: hsla(0, 0%, 100%, 0.5);
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #74b9ff;
}

.token.function,
.token.class-name {
  color: #e84393;
}

.token.regex,
.token.important,
.token.variable {
  color: #00b894;
}

.token.important,
.token.bold {
  font-weight: bold;
}
.token.italic {
  font-style: italic;
}

.token.entity {
  cursor: help;
}

pre .line-number {
  user-select: none;
  width: 4ch;
  color: #999;
  position: relative;
  display: inline-block;

  &::after {
    content: '';
    // width: 1px;
    height: 100%;
    border-right: 1px solid #999;
    position: absolute;
    right: 1ch;
  }
}
